home *** CD-ROM | disk | FTP | other *** search
- #include "bbs.h"
-
- extern char Xprlib[];
- extern char prototitle[];
- int UserAccountEdit(void)
- {
- int stat,option;
- char str[100],str2[100];
- extern char langtitle[];
- extern char lang[];
- struct User TUser;
- struct UserKeys TUserkeys;
- struct DiskObject *dobj;
- char **tooltypes;
- char *s;
- int i;
- FOREVER {
- if(Whence_The_Logon>=REMOTE_LOGON)
- {
- stat=CheckCarrier();
- if(stat==FALSE) return(SLEEP_LOGOFF);
- }
-
- /* FormFeed Line since user indiates he wants this option */
-
- if(User_keys.Userflags & USER_SCRNCLR) AEPutStr("\f");
-
- AEPutStr("\r\n");
-
- if(!(GET_BIT(ACS_EDIT_USER_NAME))) AEPutStr("1. Disabled\r\n");
- else {
- sprintf(str,"1. Name : %s\r\n",User.Name);
- AEPutStr(str);
- }
-
- if(!(GET_BIT(ACS_EDIT_USER_LOCATION))) AEPutStr("2. Disabled\r\n");
- else {
- sprintf(str,"2. From : %s\r\n",User.Location);
- AEPutStr(str);
- }
-
- if(!(GET_BIT(ACS_EDIT_PHONE_NUMBER))) AEPutStr("3. Disabled\r\n");
- else {
- sprintf(str,"3. Phone : %s\r\n",User.PhoneNumber);
- AEPutStr(str);
- }
-
- if(!(GET_BIT(ACS_EDIT_PASSWORD))) AEPutStr("4. Disabled\r\n");
- else {
- AEPutStr("4. Password : ENCRYPTED\r\n");
- }
-
- sprintf(str,"5. NumLines : %d\r\n",User.LineLength);
- AEPutStr(str);
-
- if(User.Sec_Bulletin>=ComputerEntries)
- sprintf(str,"6. Computer : NOT VALID!\r\n",User.LineLength);
- else
- sprintf(str,"6. Computer : %s\r\n",ComputerTypes[User.Sec_Bulletin]);
- AEPutStr(str);
-
- sprintf(str,"7. Scr Type : %s\r\n",langtitle);
- AEPutStr(str);
-
- /* FormFeed Line since user indiates he wants this option */
-
- if(User_keys.Userflags & USER_SCRNCLR)
- sprintf(str,"8. Scrn Clr : Y\r\n");
- else
- sprintf(str,"8. Scrn Clr : N\r\n");
-
- AEPutStr(str);
-
- if(GET_BIT(ACS_XPR_SEND) || GET_BIT(ACS_XPR_RECEIVE))
- {
- sprintf(str,"9. Protocol : %s\r\n",prototitle);
- } else {
- sprintf(str,"9. Disabled \r\n");
- }
- AEPutStr(str);
-
- if(GET_BIT(ACS_FULLEDIT))
- {
- switch(User.EditorType)
- {
- case 0: strcpy(str,"10.Editor : Prompt\r\n"); break;
- case 1: strcpy(str,"10.Editor : Line Editor\r\n"); break;
- default: strcpy(str,"10.Editor : FullScreen Editor\r\n"); break;
- }
- }
- else strcpy(str,"10.Disabled \r\n");
- AEPutStr(str);
- AEPutStr("\r\n");
-
- AEPutStr("Which to change <CR>=QUIT ? ");
-
- stat=LineInput("",str,2,KEYBOARD_TIMEOUT);
- if(stat<0) return(stat);
- if(strlen(str)==0) {
- AEPutStr("\r\n");
- Save_Account(&User,&User_keys,0,0);
- CheckUserOnLine(&User,0);
- return(SUCCESS);
- }
- if(Whence_The_Logon>=REMOTE_LOGON) {
- stat=CheckCarrier();
- if(stat==FALSE)
- return(SLEEP_LOGOFF);
- }
- option=atoi(str);
- AEPutStr("\r\n");
- switch(option) {
- case 1:
- if(!(GET_BIT(ACS_EDIT_USER_NAME)))
- break;
- Loop:
- AEPutStr("Name: ");
- strcpy(str,User.Name);
- stat=LineInput(str,str,30,KEYBOARD_TIMEOUT);
- if(stat<0) return(stat);
- if(!stricmp(User_keys.UserName,str)) break;
- if(stat=CheckifNameAllowed(str)) goto Loop;
- strcpy(str2,str);
- AEPutStr("\r\nChecking for duplicate name...");
- stat=CheckForAst(str2);
- if(stat) {
- AEPutStr("No wildcards allow in a name.\r\n\r\n");
- goto Loop;
- }
- stat=Find_User_From_Name(1,str2,&TUser,&TUserkeys);
- if(stat!=0) {
- AEPutStr("Already in use!, try another.\r\n\r\n");
- goto Loop;
- }
- AEPutStr("Ok!\r\n");
- strcpy(User.Name,str);
- strupr(str);
- strcpy(User_keys.UserName,str);
- Save_Account(&User,&User_keys,0,0);
- break;
- case 2:
- if(!(GET_BIT(ACS_EDIT_USER_LOCATION)))
- break;
- AEPutStr("From: ");
- strcpy(str,User.Location);
- stat=LineInput(str,str,29,KEYBOARD_TIMEOUT);
- if(stat<0) return(stat);
- if(strlen(str)==0)
- break;
- strcpy(User.Location,str);
- break;
- case 3:
- if(!(GET_BIT(ACS_EDIT_PHONE_NUMBER)))
- break;
- AEPutStr("Phone: ");
- strcpy(str,User.PhoneNumber);
- stat=LineInput(str,str,13,KEYBOARD_TIMEOUT);
- if(stat<0) return(stat);
- if(strlen(str)==0)
- break;
- strcpy(User.PhoneNumber,str);
- break;
- case 4:
- if(!(GET_BIT(ACS_EDIT_PASSWORD))) break;
- AEPutStr("Password: ");
- AEClearMem(GSTR1,32);
- stat=LineInput(GSTR1,GSTR1,32,KEYBOARD_TIMEOUT);
- if(stat<0) { return(stat); }
- if(strlen(GSTR1)==0) break;
- AECryptCpy(User.PassKey,GSTR1);
- break;
-
-
- case 5:
- do {
- stat=NumberOfLinesTest();
- if(stat<0) return(stat);
- } while(stat==0);
- break;
- case 6:
- if(stat=ChooseComputer())
- if(stat<0) return(stat);
- break;
- case 7:
- i=1;
-
- sprintf(GSTR1,"%sScreenTypes",Cmds->BBSLoc);
- dobj=GetDiskObject(GSTR1);
- if(dobj)
- {
- AEPutStr("\r\n");
- tooltypes=dobj->do_ToolTypes;
- sprintf(GSTR2,"TITLE.%d",i);
- while(s=FindToolType(tooltypes,GSTR2))
- {
- sprintf(GSTR2,"%d> %s\r\n",i,s);
- AEPutStr(GSTR2);
- i +=1;
- sprintf(GSTR2,"TITLE.%d",i);
- }
- AEPutStr("\r\n Type >: ");
- LineInput("",GSTR2,5,KEYBOARD_TIMEOUT);
- sprintf(GSTR1,"TYPE.%d",atoi(GSTR2));
- if(s=FindToolType(tooltypes,GSTR1))
- {
- strcpy(lang,s); sprintf(GSTR1,"TITLE.%d",atoi(GSTR2));
-
- if(s=FindToolType(tooltypes,GSTR1))
- strcpy(langtitle,s);
- User.ScreenType=atoi(GSTR2)-1;
- } FreeDiskObject(dobj);
- }else User.ScreenType=0;
- break;
- case 9:
- i=1;
- if(!GET_BIT(ACS_XPR_SEND) && !GET_BIT(ACS_XPR_RECEIVE)) break;
- sprintf(GSTR1,"%sProtocols/XprTypes",Cmds->BBSLoc);
- dobj=GetDiskObject(GSTR1);
- if(dobj)
- {
- AEPutStr("\r\n");
- tooltypes=dobj->do_ToolTypes;
- sprintf(GSTR2,"TITLE.%d",i);
- while(s=FindToolType(tooltypes,GSTR2))
- {
- sprintf(GSTR2,"%d> %s\r\n",i,s);
- AEPutStr(GSTR2);
- i +=1;
- sprintf(GSTR2,"TITLE.%d",i);
- }
- AEPutStr("\r\n Type >: ");
-
- LineInput("",GSTR2,5,KEYBOARD_TIMEOUT);
- sprintf(GSTR1,"LIBRARY.%d",atoi(GSTR2));
- if(s=FindToolType(tooltypes,GSTR1))
- {
- strcpy(Xprlib,s); sprintf(GSTR1,"TITLE.%d",atoi(GSTR2));
-
- if(s=FindToolType(tooltypes,GSTR1))
- strcpy(prototitle,s);
- User.XferProtocol=atoi(GSTR2)-1;
- } FreeDiskObject(dobj);
- }else User.XferProtocol=0;
- GetProtocol();
- break;
-
- case 8:
- /* FormFeed Line since user indiates he wants this option */
- if(User_keys.Userflags & USER_SCRNCLR) User_keys.Userflags ^= USER_SCRNCLR;
- else
- User_keys.Userflags ^= USER_SCRNCLR; /* clear the bit for linefeeds code */
- REM_BIT(ACS_CLEAR_SCREEN_MSG);
- if(User_keys.Userflags & USER_SCRNCLR) ADD_BIT(ACS_CLEAR_SCREEN_MSG);
- /* redisplay */
- break;
-
- case 10: if(!GET_BIT(ACS_FULLEDIT)) break;
- User.EditorType +=1; if(User.EditorType>2) User.EditorType=0;
- break;
- }
- }
- }
-